#include<stdio.h>
#include <string.h>
void spin (char arr[], int sz, int a)
{
	int left = 0; int right = sz-2; 
	while (a)
	{
		char tem = 0;
		tem = arr[left];
		arr[left] = arr[right];
		arr[right] = tem;
		left++;
		right--;
		a--;
	} 
}
int find(char s1[], char s2[], int sz)
{
	int left = 0; int right = sz - 2; int k = 0;
	while (left<right)
	{
		if (s1[right] == s2[left])
		{
			k++;
			left++;
			right--;
		}
		else
			break;
	}
	return k;
}
int main()
{
	char s1[] = "abcdefg";
	char s2[] = "gfedcba";
	int sz = sizeof(s1);
	int k = find(s1, s2, sz);
     spin(s1, sz, k);
	 if (strcmp(s1,s2)==0)
		 printf("1");
	 else
		 printf("0");
	return 0;
}